package com.gin.pixiv.deserializer

import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.core.JsonToken
import com.fasterxml.jackson.databind.DeserializationContext
import com.fasterxml.jackson.databind.JsonDeserializer

/**
 * @author BX-Gin
 * @from 2024/2/26 12:32
 */
class LocalDateStringDeserializer : JsonDeserializer<String>() {
    override fun deserialize(jsonParser: JsonParser?, p1: DeserializationContext?): String? {
        if (jsonParser?.hasToken(JsonToken.VALUE_FALSE) == true) {
            return null
        }
        return jsonParser?.valueAsString
    }
}